From: kaf24@firebug.cl.cam.ac.uk Date: Mon, 10 Apr 2006 16:32:30 +0000 (+0100) Subject: Fail the build if NR_hypercalls is not a power of two. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16158^2~7^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=7ddc2369b20e6b9e4f067585d8c7389b33b00abb;p=xen.git Fail the build if NR_hypercalls is not a power of two. Making this requirement clearer originally suggested by Muli Ben Yehuda. Signed-off-by: Keir Fraser --- diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index 23aabeb2b9..35efb1ba63 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -65,8 +65,13 @@ #define barrier() __asm__ __volatile__("": : :"memory") +/* A power-of-two value greater than or equal to number of hypercalls. */ #define NR_hypercalls 32 +#if NR_hypercalls & (NR_hypercalls - 1) +#error "NR_hypercalls must be a power-of-two value" +#endif + #ifndef NDEBUG #define MEMORY_GUARD #ifdef __x86_64__